home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / spaceambush.swf / scripts / frame_286 / PlaceObject2_585_99 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2007-03-12  |  881 b   |  43 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.level >= 15)
  3.    {
  4.       if(_root.amithealth < 50)
  5.       {
  6.          if(st == 1)
  7.          {
  8.             att = true;
  9.             st = 0;
  10.          }
  11.       }
  12.    }
  13.    if(_root.amitavaplay == false)
  14.    {
  15.       att = false;
  16.    }
  17.    if(att == true)
  18.    {
  19.       dx = _X - _root.tank._x;
  20.       dy = _Y - _root.tank._y;
  21.       d = Math.sqrt(dx * dx + dy * dy);
  22.       if(50 < d)
  23.       {
  24.          rad = Math.atan2(dy,dx) + 3.141592653589793;
  25.          deg = rad * 180 / 3.141592653589793;
  26.          _rotation = deg;
  27.          b = 3 * Math.cos(rad);
  28.          p = 3 * Math.sin(rad);
  29.          _X = _X + b;
  30.          _Y = _Y + p;
  31.       }
  32.       else if(0 < _root.amithealth)
  33.       {
  34.          _alpha = _alpha - 1;
  35.          if(_alpha < 1)
  36.          {
  37.             att = false;
  38.             this.x = -3000;
  39.          }
  40.       }
  41.    }
  42. }
  43.